/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Mr.Yang
 * @Date: 2023/04/12/19:35
 * @Description:
 */
package com.hxm.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;

@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket docket(){
        Docket docket = new Docket(DocumentationType.SWAGGER_2).groupName("Chicken fame")
                .apiInfo(getInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.hxm.controller"))
                .build();
        return docket;
    }

    private ApiInfo getInfo(){
        Contact DEFAULT_CONTACT = new Contact("蔡徐坤", "https://www.qubiaoqing.cn/showinfo-1-183418-0.html", "15137602985@qq.com");
        ApiInfo apiInfo=new ApiInfo("一个真正的Man测试系统API", "一个真正的Man测试系统API", "1.6.0", "https://www.keaitupian.cn/biaoqingbao/19657.html",
                DEFAULT_CONTACT, "一个真正的Man", "http://www.cxk.com", new ArrayList<VendorExtension>());
        return apiInfo;
    }
}